# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-game-libretro-frodo
pkgver=0.0.1.25
_realname=Nexus
pkgrel=0
pkgdesc="Commodore - C64 (Frodo) game addon for Kodi"
options="!check" # no test suite
url="https://github.com/kodi-game/game.libretro.frodo"
arch="x86_64 aarch64 armv7" # kodi is available only on these architectures
license="GPL-2.0-only"
makedepends="cmake kodi-dev samurai"
depends="kodi-game-libretro libretro-frodo"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/kodi-game/game.libretro.frodo/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/game.libretro.frodo-$pkgver-$_realname"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -r "$pkgdir"/usr/lib/kodi/addons/game.libretro.frodo/game.libretro.frodo.so
	ln -s /usr/lib/libretro/frodo_libretro.so \
		"$pkgdir"/usr/lib/kodi/addons/game.libretro.frodo/game.libretro.frodo.so
}

sha512sums="
f96e40fa6f177bb45a353a31fe121d1040166419fc589f8aee28ebc0da25083657973c23c673a246b6375c60c909c9d7eeb92738cd3a96212547e48e66f3126e  kodi-game-libretro-frodo-0.0.1.25-Nexus.tar.gz
"
